//
//  SHUserCredistButton.m
//  JiFengDaRen
//
//  Created by SH_iOS on 2017/5/27.
//  Copyright © 2017年 SH_iOS. All rights reserved.
//

#import "SHUserCreditsButton.h"
@interface SHUserCreditsButton()
@property(nonatomic,strong)SHLabel *countLabel;
@property(nonatomic,strong)SHLabel *creditsLabel;

@end
@implementation SHUserCreditsButton

- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self countLabel];
        [self creditsLabel];
        self.highlightedBackgroundColor = KREDCOLOR;
    
    }
    return self;
}


- (SHLabel *)countLabel{
    
    if (!_countLabel) {
        _countLabel = [SHLabel labelWithText:@"0.00" font:17 textColor:[UIColor whiteColor] textAlignment:1];
//        _countLabel.userInteractionEnabled = YES;
        _countLabel.font = KSHSystemFont(17);

        [self addSubview:_countLabel];
    }
    return _countLabel;
}


- (SHLabel *)creditsLabel{
    
    if (!_creditsLabel) {
        _creditsLabel = [SHLabel labelWithText:@"" font:11 textColor:[UIColor whiteColor] textAlignment:1];
//        _creditsLabel.userInteractionEnabled = YES;

        [self addSubview:_creditsLabel];
    }
    return _creditsLabel;
}

- (void)layoutSubviews{
    [_countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.height.mas_equalTo(__I6Height(17));
        make.top.mas_equalTo(self.mas_top).with.offset(__I6Height(9));
    }];
    [_creditsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.height.mas_equalTo(__I6Height(11));
        make.bottom.mas_equalTo(self.mas_bottom).with.offset(__I6Height(-11));
    }];
    
}

- (void)setCounts:(NSString *)counts{
    _countLabel.text = counts;

}

- (void)setCreditsName:(NSString *)creditsName{
    _creditsLabel.text = creditsName;
}


@end
